import time
from selenium import webdriver
from selenium.webdriver.common.by import By

pic_time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime(time.time()))


def search(words):
    wd = webdriver.Chrome()
    wd.get("https://cn.bing.com/")
    wd.find_element(By.ID, "sb_form_q").send_keys(words)
    wd.find_element(By.ID, "search_icon").click()
    time.sleep(2)
    wd.save_screenshot(pic_time + ".png")
    wd.quit()

if __name__ == '__main__':
    search("1")
    search("2")
    search("3")
